package demo2;

/**
 * @Author liangzai
 * @Description:
 */

class Dog extends Animal{

    public Dog(String name){
        super(name);
    }

    @Override
    public void shout() {
        System.out.println(String.format("%s发出汪汪叫", this.name));
    }

    public void superShout(){
        super.shout();
    }
}

class Animal{
    String name;
    public void shout(){
        System.out.println(this.name + "发出叫声");
    }

    public Animal(String name) {
        this.name = name;
    }
}

